﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace iLangl.Model
{
	public class SettingsForCustomerRequestContext : BaseContext
	{
		private SettingsForCustomer settings = null;
		public override void SetContext(object context)
		{
			base.SetContext(context);

			if (context is SettingsForCustomer)
			{
				settings = context as SettingsForCustomer;
			}


		}

		public override object GetContext()
		{
			startDocument();
			writer.WriteStartElement("TPSettings");
			
			InitExtendedAttributes(writer, settings);


			WorkareaRequestContext termContext = new WorkareaRequestContext();
			termContext.SetContext(settings.WorkAreas);
			termContext.Write(writer);
			
			

			ProductsRequestContext productContext = new ProductsRequestContext();
			productContext.SetContext(settings.Products);
			productContext.Write(writer);
			writer.WriteEndElement();

			return endDocument();
		}
	}
}
